You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 's%20arter#%' AND p_show_siamshop='yes' and p_pause = '' and...' at line 3select count(*) as count_p from product where cat_id LIKE '%#arter's%20arter#%' AND p_show_siamshop='yes' and p_pause = '' and p_stop = 0